package com.wing.sell.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.sell.model.entity.Order;
import com.wing.sell.model.request.DeliveryRecordForm;
import com.wing.sell.model.request.OrderForm;
import com.wing.sell.model.request.OrderFormalForm;
import com.wing.sell.model.response.OrderSkuDetailSearchVo;
import com.wing.sell.model.response.OrderVO;

import java.util.List;
import java.util.Map;

/**
 * 销售订单表-Service
 *
 * @author
 */
public interface OrderService extends IService<Order> {

    /**
     * 添加
     *
     * @param orderForm
     * @return
     */
     void add(OrderForm orderForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<OrderVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<OrderVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    OrderVO get4appById(Long id);

    void submit(Long id,Integer type);

    void addFormal(OrderForm orderForm);

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    OrderVO getDetailById(Long id);

    /**
     * 查询订单中物料信息
     * @param orderId
     * @param warehouseId
     * @return
     */
    List<OrderSkuDetailSearchVo> listByInfo(Long orderId, Long warehouseId);

    /**
     * 生成交付记录
     * @param deliveryRecordForm
     * @return
     */
    Integer generateOrderResult(DeliveryRecordForm deliveryRecordForm);

    /**
     * 添加正式订单
     * @param orderFormalForm
     */
    void addFormalOrder(OrderFormalForm orderFormalForm);

    /**
     * 查询订单的物料详情
     * @param orderId
     * @return
     */
    List<OrderSkuDetailSearchVo> listByInfoBySku(Long orderId);
}
